home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / demos / 20 / tvxsrc / stdiotvx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1987-07-19  |  1.3 KB  |  60 lines

  1. /* stdio.h fixed to make it compatible with the rest of the world */
  2.  
  3. #define mc68k 0
  4.  
  5. #define TRUE 1
  6. #define FALSE 0
  7.  
  8. #define    NULL    0
  9. #define NULLPTR (char *) 0
  10. #define    EOF    (-1)
  11.  
  12. #define BUFSIZ    512
  13. #define MAXFILES    16
  14. struct _iobuf {    
  15.     int _fd;
  16.     int _flag;
  17.     char *_base;
  18.     char *_ptr;
  19.     int _cnt;
  20. };
  21.  
  22. #ifndef FILE
  23. extern struct _iobuf _iob[MAXFILES];
  24. #define FILE struct _iobuf
  25. #endif
  26. #define NULLFILE ((FILE *)0)
  27.  
  28. #define _IOREAD    0x01
  29. #define _IOWRT    0x02
  30. #define _IOABUF    0x04
  31. #define _IONBUF    0x08
  32. #define _IOERR    0x10
  33. #define _IOEOF    0x20
  34. #define _IOLBUF 0x40
  35. #define _IOSTRI    0x80
  36. #define _IOASCI    0x100
  37.  
  38. #define stdin  (&_iob[0])
  39. #define stdout (&_iob[1])
  40. #define stderr (&_iob[2])
  41.  
  42. #define clearerr(p) ((p)->_flag &= ~_IOERR)
  43. #define feof(p) ((p)->_flag & _IOEOF)
  44. #define ferror(p) ((p)->_flag & _IOERR)
  45. #define fileno(p) ((p)->_fd)
  46. #define getchar() getc(stdin)
  47. #define putchar(c) putc(c,stdout)
  48. #define putc fputc
  49. #define getc fgetc
  50.  
  51.  
  52. #define    abs(x)    ((x) < 0 ? -(x) : (x))
  53.  
  54. #define MAX(x,y)   (((x) > (y)) ? (x) :  (y))
  55. #define    MIN(x,y)   (((x) < (y)) ? (x) :  (y))
  56. #define max(x,y)   (((x) > (y)) ? (x) :  (y))
  57. #define    min(x,y)   (((x) < (y)) ? (x) :  (y))
  58.  
  59. /*************************** end of stdio.h *********************************/
  60. ə